package com.servicebuck.database.entity;
// Generated Aug 30, 2011 11:09:02 PM by Hibernate Tools 3.4.0.CR1


import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Offering generated by hbm2java
 */
@Entity
@Table(name="offering"
    ,catalog="telluricng"
)
public class Offering  implements java.io.Serializable {


     private long offeringId;
     private Service service;
     private Offercategory offercategory;
     private Date startDate;
     private Date endDate;
     private String eula;
     private String name;
     private String description;
     private Integer inactive;
     private Set<Serviceorder> serviceorders = new HashSet<Serviceorder>(0);
     private Set<Ticket> tickets = new HashSet<Ticket>(0);

    public Offering() {
    }

	
    public Offering(long offeringId, Service service, Date startDate, String name) {
        this.offeringId = offeringId;
        this.service = service;
        this.startDate = startDate;
        this.name = name;
    }
    public Offering(long offeringId, Service service, Offercategory offercategory, Date startDate, Date endDate, String eula, String name, String description, Integer inactive, Set<Serviceorder> serviceorders, Set<Ticket> tickets) {
       this.offeringId = offeringId;
       this.service = service;
       this.offercategory = offercategory;
       this.startDate = startDate;
       this.endDate = endDate;
       this.eula = eula;
       this.name = name;
       this.description = description;
       this.inactive = inactive;
       this.serviceorders = serviceorders;
       this.tickets = tickets;
    }
   
     @Id 

    
    @Column(name="offering_id", unique=true, nullable=false)
    public long getOfferingId() {
        return this.offeringId;
    }
    
    public void setOfferingId(long offeringId) {
        this.offeringId = offeringId;
    }

@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="service_id", nullable=false)
    public Service getService() {
        return this.service;
    }
    
    public void setService(Service service) {
        this.service = service;
    }

@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="category_id")
    public Offercategory getOffercategory() {
        return this.offercategory;
    }
    
    public void setOffercategory(Offercategory offercategory) {
        this.offercategory = offercategory;
    }

    @Temporal(TemporalType.TIMESTAMP)
    @Column(name="start_date", nullable=false, length=19)
    public Date getStartDate() {
        return this.startDate;
    }
    
    public void setStartDate(Date startDate) {
        this.startDate = startDate;
    }

    @Temporal(TemporalType.TIMESTAMP)
    @Column(name="end_date", length=19)
    public Date getEndDate() {
        return this.endDate;
    }
    
    public void setEndDate(Date endDate) {
        this.endDate = endDate;
    }

    
    @Column(name="eula", length=5000)
    public String getEula() {
        return this.eula;
    }
    
    public void setEula(String eula) {
        this.eula = eula;
    }

    
    @Column(name="name", nullable=false, length=250)
    public String getName() {
        return this.name;
    }
    
    public void setName(String name) {
        this.name = name;
    }

    
    @Column(name="description", length=500)
    public String getDescription() {
        return this.description;
    }
    
    public void setDescription(String description) {
        this.description = description;
    }

    
    @Column(name="inactive")
    public Integer getInactive() {
        return this.inactive;
    }
    
    public void setInactive(Integer inactive) {
        this.inactive = inactive;
    }

@OneToMany(fetch=FetchType.LAZY, mappedBy="offering")
    public Set<Serviceorder> getServiceorders() {
        return this.serviceorders;
    }
    
    public void setServiceorders(Set<Serviceorder> serviceorders) {
        this.serviceorders = serviceorders;
    }

@OneToMany(fetch=FetchType.LAZY, mappedBy="offering")
    public Set<Ticket> getTickets() {
        return this.tickets;
    }
    
    public void setTickets(Set<Ticket> tickets) {
        this.tickets = tickets;
    }




}


